home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_31_(10-1984).d64
/
new 51k backup
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
5KB
|
168 lines
100 REM MOD FR 6/83 GAZETTE BY J RUBIN
110 GOTO700
199 REM READ DISK ERR
200 INPUT#1,ER,ER$,E2%,E3%:RETURN
299 REM READ BLOCK
300 POKE53280,NU
310 C=.:V=1107+S1*40+T1
320 REM ADD SKIP IF YOU HAVE PARALLEL IEEE INTERFACE HERE
330 POKE255,BB+NU
340 PRINT#1,"U1";3;.;T1;S1:GOSUB200:IFER=.GOTO370
350 C=C+1:IFC<3GOTO340
360 POKEV,ER:SYS902:RETURN
370 PRINT#1,"B-P";3;.:SYSMA
380 IFNU<>.THENPOKEV,127
390 IFST<>.ANDST<>64THENGOSUB200:GOTO360
400 RETURN
499 REM WRITE BLOCK
500 POKE53280,NU
510 C=.
520 IFU%=.THENPRINT#1,"B-A";.;T1;S1
530 PRINT#1,"B-P";3;.
540 IFNU<>.THENPOKE1107+S1*40+T1,32
550 REM ADD SKIP IF YOU HAVE PARALLEL IEEE INTERFACE HERE
560 POKE255,BB+NU:SYSMA+3
570 IFST<>.ANDST<>64THENPRINT"IEEE WRITE"ST:GOTO10000
580 PRINT#1,"U2";3;.;T1;S1
590 GOSUB200:IFER=.GOTO620
600 C=C+1:IFC<3GOTO580
610 PRINT"UNRECOVERABLE WRITE ERROR"ER,ER$,E2%,E3%:GOTO10000
620 RETURN
699 REM MAIN PROGRAM
700 FORI=828TO923:READA:POKEI,A:NEXT:PRINT"";:POKE53281,6:POKE53280,2:POKE.,47
710 FORI=0TO24:POKE54272+I,0:NEXT:POKE54273,20:POKE54277,153:POKE54278,153
720 POKE55,.:POKE56,35:CLR:BB=35:N=220:BA=BB*256:MA=828
730 DIMBM%(35,21):FORJ=.TO7:TA(J)=2^J:NEXT
740 PRINT"[147]BACKUP 1541"
750 PRINT"'GOTO10000' IF PROGRAM QUITS ABNORMALLY"
760 OPEN1,8,15
770 GOSUB2000
780 PRINT"[147]DO YOU WANT TO BLANK THE SCREEN?";
790 GOSUB3200:IFA$="Y"THENSB=1:PRINT#1,"UI-"
800 PRINT"DO YOU WANT TO COPY ALL 683[146] SECTORS?";
810 GOSUB3200:IFA$="Y"THENDB=1
820 PRINT"[147]";:D$="S":GOSUB3000:I2$=IR$
830 IFDR$<>"2A"THENPRINT"[147]ILLEGAL DOS 1.0 DISK":GOTO10000
840 IFI2$=I1$THENPRINT"[147]SOURCE AND DESTINATION HAVE SAME ID CODE":GOTO10000
850 GOSUB2500
860 IFDBTHENTS=1:TF=35
870 T=TS:S=.:NU=1:T1=T:S1=S
880 PRINT#1,"I0":OPEN3,8,3,"#"
890 U%=BM%(T1,S1):IFU%=-1THEN920
900 IF(U%=.)OR(DB=1)THENGOSUB300:NU=NU+1:IFNU>NTHEN930
910 S1=S1+1:GOTO890
920 S1=.:T1=T1+1:IFT1<=TFGOTO890
930 CLOSE3
940 D$="D":GOSUB3000:A$="N":IFI1$=""THENI1$=IR$:A$="Y":IFI1$=I2$GOTO840
950 IFA$="Y"THENPRINT#1,"N0:"DN$:GOSUB200:IFER<>0THENPRINTER,ER$:GOTO10000
960 IFIR$<>I1$THENPRINT"";:GOTO940
970 PRINT#1,"I0":OPEN3,8,3,"#"
980 NU=1:T1=T:S1=S
990 U%=BM%(T1,S1):IFU%=-1GOTO1020
1000 IF(U%=.)OR(DB=1)THENGOSUB500:NU=NU+1:IFNU>NGOTO1030
1010 S1=S1+1:GOTO990
1020 S1=.:T1=T1+1:IFT1<=TFGOTO990
1030 CLOSE3
1040 S=S1+1:IFS>20THENS=.:T1=T1+1
1050 T=T1:IFT>TFGOTO1080
1060 D$="S":GOSUB3000:IFIR$<>I2$THENPRINT"";:GOTO1060
1070 NU=1:T1=T:S1=S:GOTO880
1080 POKE53265,27:PRINT#1,"UI+":CLOSE1
1090 POKE55,0:POKE56,160:CLR
1100 POKE53280,6:PRINT"[147]BACKUP COMPLETE"
1110 OPEN1,8,0,"$0":GET#1,A$,B$:N$=CHR$(0)
1120 GET#1,A$,B$:IFB$=""GOTO1160
1130 GET#1,A$,B$:PRINTASC(A$+N$)+256*ASC(B$+N$);
1140 GET#1,A$:IFA$<>""THENPRINTA$;:GOTO1140
1150 PRINT:GOTO1120
1160 CLOSE1:END
1999 REM FORMAT DISK
2000 INPUT"DESTINATION DISK NAME ";DN$
2010 IFDN$=""THENPRINT"[145][145][145][145]":GOTO2000
2020 IFLEN(DN$)>16THENCLR:GOTO400
2030 F=0:FORJ=1TOLEN(DN$):S1$=MID$(DN$,J,1)
2040 IFS1$=""ORS1$=CHR$(34)THENF=1
2050 NEXTJ:IFFTHENPRINT"[145][145][145][145]":GOTO2000
2060 PRINT"TOTALLY FORMAT THE DISK?";
2070 GOSUB3200:IFA$="N"THENRETURN
2080 INPUT"UNIQUE DISK ID ";I1$
2090 IFI1$=""THENPRINT"[145][145]":GOTO2080
2100 IFLEN(I1$)<>2THENPRINT"[145][145]":GOTO2080
2110 D$="E":PRINT"[147]";:GOSUB3000
2120 IFER<>0GOTO2160
2130 POKE54276,33:POKE54296,15:PRINT:PRINT"ALREADY FORMATTED DISK!!!"
2140 PRINT"ARE YOU SURE???";:GOSUB3200:POKE54276,32:POKE54296,.
2150 IFA$<>"Y"GOTO2000
2160 POKE54276,32:POKE54296,0:PRINT#1,"N0:"+DN$+","+I1$
2170 GOSUB200
2180 IFERTHENPRINTER$:GOTO10000
2190 RETURN
2499 REM GET BAM
2500 TS=1:TF=.
2510 PRINT#1,"I0":OPEN3,8,3,"#"
2520 S9=0
2530 POKE53281,1:PRINT"[147]";:POKE53281,6
2540 NU=0:T1=18:S1=0:C0$=CHR$(.):GOSUB300:CLOSE3
2550 FORI=0TO20:POKE1104+I*40,ASC(RIGHT$(STR$(I),1)):NEXT
2560 FORI=1TO35:POKE1987+I,ASC(RIGHT$(STR$(I),1)):NEXT
2570 POKE53265,27:BY=4
2580 T%=(BY-4)/4+1
2590 IFPEEK(BA+BY)=.THENFORJ=.TO20:BM%(T%,J)=.:NEXT:BY=BY+4:GOTO2640
2600 S=0
2610 BY=BY+1:A0=PEEK(BA+BY):FORJ=.TO7:U%=S:IFU%>21THENU%=21
2615 BM%(T%,U%)=A0ANDTA(J):S=S+1:NEXT
2620 IFS<22THEN2610
2630 BY=BY+1
2640 ES=21:IFT%>17THENES=19
2650 IFT%>24THENES=18
2660 IFT%>30THENES=17
2670 FORJ=ESTO21:BM%(T%,J)=-1:NEXT
2680 SM=.:FORJ=.TO20:SL%=1107+J*40+T%:POKESL%,45:IFBM%(T%,J)<>.THEN2700
2690 SM=SM+1:POKESL%,160
2700 NEXT:S9=S9+SM
2710 IFT%<=17THEN2750
2720 POKE1907+T%,46:POKE1867+T%,46:IFT%<=24THEN2750
2730 POKE1827+T%,46:IFT%<=30THEN2750
2740 POKE1787+T%,46
2750 IFSM=.ANDTS=T%THENTS=TS+1:GOTO2770
2760 IFSM<>.THENTF=T%
2770 IFBY<143GOTO2580
2780 IFDB=1THENS9=683
2790 PRINT""S9;"BLOCKS TO XFER";
2800 S8=90+25+(.650+.980)*S9
2810 IFSB=0THENS8=S8*1.25
2820 S7=INT(S8/60)
2830 PRINTS7":"INT(S8-S7*60);
2840 IFSB=1THENPOKE53265,11
2850 RETURN
2999 REMCHANGE DISK ROUTINE
3000 POKE53265,27
3010 IFD$="D"THENS1$="DESTINATION":POKE53280,2:GOTO3040
3020 IFD$="E"THENS1$="DESTINATION":POKE53280,2:GOTO3040
3030 S1$="SOURCE":POKE53280,5
3040 POKE54276,33:POKE54296,15:PRINT"INSERT ";S1$;" DISK, PRESS SHIFT [146][191][157]";
3050 POKE204,0:WAIT653,1:POKE54276,32:POKE54296,0
3060 IFSB=1THENPOKE53265,11
3070 POKE204,1:OPEN2,8,0,"$0"
3080 GOSUB200:IFD$="E"THENCLOSE2:RETURN
3090 IFER>0THENCLOSE2:PRINT"";:GOTO3000
3100 FORJ=1TO26:GET#2,A$:NEXTJ
3110 GET#2,A$:GET#2,B$:IR$=A$+B$
3120 GET#2,A$:GET#2,A$:GET#2,B$:DR$=A$+B$
3130 PRINT" ";
3140 CLOSE2:RETURN
3199 REM GET Y/N ROUTINE
3200 PRINTTAB(37)"[191][157]";
3210 POKE204,0:GETA$:IFA$=""THEN3210
3220 POKE204,1
3230 IFA$="Y"THENPRINT"YES":RETURN
3240 IFA$="N"THENPRINT"NO":RETURN
3250 GOTO3210
9999 REM ABNORMAL EXIT
10000 PRINT#1,"UJ":POKE55,0:POKE56,160:CLR:POKE53265,27:STOP
15000 DATA56,176,3,56,176,34,162,3,32,198,255,160,0,132,254,32,207,255,120,162
15010 DATA52,134,1,145,254,162,55,134,1,88,165,144,208,3,200,208,234,76,204,255
15020 DATA162,3,32,201,255,160,0,132,254,120,169,52,133,1,177,254,162,55,134,1
15030 DATA88,32,210,255,165,144,208,3,200,208,234,76,204,255,160,.,132,254
15040 DATA169,255,120,162,52,134,1,145,254,200,208,251,162,55,134,1,88,96